import 'package:flutter/cupertino.dart';
import 'package:hitutor/UI/AudioPlayerPage.dart';
import 'package:hitutor/UI/HiNote/TeachMaterial/TeachMaterialList.dart';
import 'package:hitutor/Util/Global.dart';
import 'package:hitutor/Util/HttpGo.dart';
import 'package:hitutor/Util/MyColor.dart';
import 'package:hitutor/Util/PageUtil.dart';
import 'package:hitutor/Widget/MyBgPage.dart';
import 'package:hitutor/Widget/MyDialog.dart';
import 'package:hitutor/Widget/MyImage.dart';
import 'package:hitutor/Widget/MyPage.dart';

import '../VideoPlayerPage.dart';

// class ChooseMaterial extends StatefulWidget {
//   String lessonId = "";
//
//   ChooseMaterial(this.lessonId);
//
//   @override
//   State<StatefulWidget> createState() {
//     return _ChooseMaterial();
//   }
// }
//
// class _ChooseMaterial extends State<ChooseMaterial> {
//   @override
//   void initState() {
//     WidgetsBinding.instance?.addPostFrameCallback((timeStamp) {
//       getFiles();
//     });
//     super.initState();
//   }
//
//   getFiles() {
//     HttpGo(context).get("/Material/GetPreviewMaterial?lessonId=${widget.lessonId}", {}, (data) {}, (code, error) => showToast(error));
//   }
//
//   @override
//   Widget build(BuildContext context) {
//     return MyBgPage(
//         "",
//         Container(
//             child: ListView.builder(
//                 padding: EdgeInsets.fromLTRB(0, 8, 0, 16),
//                 itemCount: 11,
//                 itemBuilder: (BuildContext context, int index) {
//                   return ItemMaterial(index == 1, index == 1 ? "教材-視頻" : "教材-音頻", onTap: () {
//                     index == 1 ? PageUtil().open(context, VideoPlayerPage(Global.videoUrl)) : PageUtil().open(context, AudioPlayerPage());
//                   });
//                 })));
//   }
// }
